home *** CD-ROM | disk | FTP | other *** search
-
- {*******************************************************}
- { }
- { Delphi Runtime Library }
- { Windows 32bit API Interface Unit }
- { }
- { Copyright (c) 1996,97 Borland International }
- { }
- {*******************************************************}
-
- unit OleDlg;
-
- {$WEAKPACKAGEUNIT}
-
- interface
-
- uses Windows, CommCtrl, ActiveX;
-
- const
-
- { Help Button Identifier }
-
- IDC_OLEUIHELP = 99;
-
- { Insert Object Dialog identifiers }
-
- IDC_IO_CREATENEW = 2100;
- IDC_IO_CREATEFROMFILE = 2101;
- IDC_IO_LINKFILE = 2102;
- IDC_IO_OBJECTTYPELIST = 2103;
- IDC_IO_DISPLAYASICON = 2104;
- IDC_IO_CHANGEICON = 2105;
- IDC_IO_FILE = 2106;
- IDC_IO_FILEDISPLAY = 2107;
- IDC_IO_RESULTIMAGE = 2108;
- IDC_IO_RESULTTEXT = 2109;
- IDC_IO_ICONDISPLAY = 2110;
- IDC_IO_OBJECTTYPETEXT = 2111;
- IDC_IO_FILETEXT = 2112;
- IDC_IO_FILETYPE = 2113;
- IDC_IO_INSERTCONTROL = 2114;
- IDC_IO_ADDCONTROL = 2115;
- IDC_IO_CONTROLTYPELIST = 2116;
-
- { Paste Special Dialog identifiers }
-
- IDC_PS_PASTE = 500;
- IDC_PS_PASTELINK = 501;
- IDC_PS_SOURCETEXT = 502;
- IDC_PS_PASTELIST = 503;
- IDC_PS_PASTELINKLIST = 504;
- IDC_PS_DISPLAYLIST = 505;
- IDC_PS_DISPLAYASICON = 506;
- IDC_PS_ICONDISPLAY = 507;
- IDC_PS_CHANGEICON = 508;
- IDC_PS_RESULTIMAGE = 509;
- IDC_PS_RESULTTEXT = 510;
-
- { Change Icon Dialog identifiers }
-
- IDC_CI_GROUP = 120;
- IDC_CI_CURRENT = 121;
- IDC_CI_CURRENTICON = 122;
- IDC_CI_DEFAULT = 123;
- IDC_CI_DEFAULTICON = 124;
- IDC_CI_FROMFILE = 125;
- IDC_CI_FROMFILEEDIT = 126;
- IDC_CI_ICONLIST = 127;
- IDC_CI_LABEL = 128;
- IDC_CI_LABELEDIT = 129;
- IDC_CI_BROWSE = 130;
- IDC_CI_ICONDISPLAY = 131;
-
- { Convert Dialog identifiers }
-
- IDC_CV_OBJECTTYPE = 150;
- IDC_CV_DISPLAYASICON = 152;
- IDC_CV_CHANGEICON = 153;
- IDC_CV_ACTIVATELIST = 154;
- IDC_CV_CONVERTTO = 155;
- IDC_CV_ACTIVATEAS = 156;
- IDC_CV_RESULTTEXT = 157;
- IDC_CV_CONVERTLIST = 158;
- IDC_CV_ICONDISPLAY = 165;
-
- { Edit Links Dialog identifiers }
-
- IDC_EL_CHANGESOURCE = 201;
- IDC_EL_AUTOMATIC = 202;
- IDC_EL_CANCELLINK = 209;
- IDC_EL_UPDATENOW = 210;
- IDC_EL_OPENSOURCE = 211;
- IDC_EL_MANUAL = 212;
- IDC_EL_LINKSOURCE = 216;
- IDC_EL_LINKTYPE = 217;
- IDC_EL_LINKSLISTBOX = 206;
- IDC_EL_COL1 = 220;
- IDC_EL_COL2 = 221;
- IDC_EL_COL3 = 222;
-
- { Busy dialog identifiers }
-
- IDC_BZ_RETRY = 600;
- IDC_BZ_ICON = 601;
- IDC_BZ_MESSAGE1 = 602;
- IDC_BZ_SWITCHTO = 604;
-
- { Update Links dialog identifiers }
-
- IDC_UL_METER = 1029;
- IDC_UL_STOP = 1030;
- IDC_UL_PERCENT = 1031;
- IDC_UL_PROGRESS = 1032;
-
- { User Prompt dialog identifiers }
-
- IDC_PU_LINKS = 900;
- IDC_PU_TEXT = 901;
- IDC_PU_CONVERT = 902;
- IDC_PU_ICON = 908;
-
- { General Properties identifiers }
-
- IDC_GP_OBJECTNAME = 1009;
- IDC_GP_OBJECTTYPE = 1010;
- IDC_GP_OBJECTSIZE = 1011;
- IDC_GP_CONVERT = 1013;
- IDC_GP_OBJECTICON = 1014;
- IDC_GP_OBJECTLOCATION = 1022;
-
- { View Properties identifiers }
-
- IDC_VP_PERCENT = 1000;
- IDC_VP_CHANGEICON = 1001;
- IDC_VP_EDITABLE = 1002;
- IDC_VP_ASICON = 1003;
- IDC_VP_RELATIVE = 1005;
- IDC_VP_SPIN = 1006;
- IDC_VP_SCALETXT = 1034;
- IDC_VP_ICONDISPLAY = 1021;
- IDC_VP_RESULTIMAGE = 1033;
-
- { Link Properties identifiers }
-
- IDC_LP_OPENSOURCE = 1006;
- IDC_LP_UPDATENOW = 1007;
- IDC_LP_BREAKLINK = 1008;
- IDC_LP_LINKSOURCE = 1012;
- IDC_LP_CHANGESOURCE = 1015;
- IDC_LP_AUTOMATIC = 1016;
- IDC_LP_MANUAL = 1017;
- IDC_LP_DATE = 1018;
- IDC_LP_TIME = 1019;
-
- { Dialog Identifiers as passed in Help messages to identify the source }
-
- IDD_INSERTOBJECT = 1000;
- IDD_CHANGEICON = 1001;
- IDD_CONVERT = 1002;
- IDD_PASTESPECIAL = 1003;
- IDD_EDITLINKS = 1004;
- IDD_BUSY = 1006;
- IDD_UPDATELINKS = 1007;
- IDD_CHANGESOURCE = 1009;
- IDD_INSERTFILEBROWSE = 1010;
- IDD_CHANGEICONBROWSE = 1011;
- IDD_CONVERTONLY = 1012;
- IDD_CHANGESOURCE4 = 1013;
- IDD_GNRLPROPS = 1100;
- IDD_VIEWPROPS = 1101;
- IDD_LINKPROPS = 1102;
-
- { The following Dialogs are message dialogs used by OleUIPromptUser API }
-
- IDD_CANNOTUPDATELINK = 1008;
- IDD_LINKSOURCEUNAVAILABLE = 1020;
- IDD_SERVERNOTFOUND = 1023;
- IDD_OUTOFMEMORY = 1024;
- IDD_SERVERNOTREG = 1021;
- IDD_LINKTYPECHANGED = 1022;
-
- { Delimeter used to separate ItemMoniker pieces of a composite moniker }
-
- OLESTDDELIM = '\';
-
- { Strings for registered messages }
-
- SZOLEUI_MSG_HELP = 'OLEUI_MSG_HELP';
- SZOLEUI_MSG_ENDDIALOG = 'OLEUI_MSG_ENDDIALOG';
- SZOLEUI_MSG_BROWSE = 'OLEUI_MSG_BROWSE';
- SZOLEUI_MSG_CHANGEICON = 'OLEUI_MSG_CHANGEICON';
- SZOLEUI_MSG_CLOSEBUSYDIALOG = 'OLEUI_MSG_CLOSEBUSYDIALOG';
- SZOLEUI_MSG_CONVERT = 'OLEUI_MSG_CONVERT';
- SZOLEUI_MSG_CHANGESOURCE = 'OLEUI_MSG_CHANGESOURCE';
- SZOLEUI_MSG_ADDCONTROL = 'OLEUI_MSG_ADDCONTROL';
- SZOLEUI_MSG_BROWSE_OFN = 'OLEUI_MSG_BROWSE_OFN';
-
- { Identifiers for SZOLEUI_MSG_BROWSE_OFN (in wParam) }
-
- ID_BROWSE_CHANGEICON = 1;
- ID_BROWSE_INSERTFILE = 2;
- ID_BROWSE_ADDCONTROL = 3;
- ID_BROWSE_CHANGESOURCE = 4;
-
- { Standard success/error definitions }
-
- OLEUI_FALSE = 0;
- OLEUI_SUCCESS = 1; { No error, same as OLEUI_OK }
- OLEUI_OK = 1; { OK button pressed }
- OLEUI_CANCEL = 2; { Cancel button pressed }
-
- OLEUI_ERR_STANDARDMIN = 100;
- OLEUI_ERR_STRUCTURENULL = 101; { Standard field validation }
- OLEUI_ERR_STRUCTUREINVALID = 102;
- OLEUI_ERR_CBSTRUCTINCORRECT = 103;
- OLEUI_ERR_HWNDOWNERINVALID = 104;
- OLEUI_ERR_LPSZCAPTIONINVALID = 105;
- OLEUI_ERR_LPFNHOOKINVALID = 106;
- OLEUI_ERR_HINSTANCEINVALID = 107;
- OLEUI_ERR_LPSZTEMPLATEINVALID = 108;
- OLEUI_ERR_HRESOURCEINVALID = 109;
-
- OLEUI_ERR_FINDTEMPLATEFAILURE = 110; { Initialization errors }
- OLEUI_ERR_LOADTEMPLATEFAILURE = 111;
- OLEUI_ERR_DIALOGFAILURE = 112;
- OLEUI_ERR_LOCALMEMALLOC = 113;
- OLEUI_ERR_GLOBALMEMALLOC = 114;
- OLEUI_ERR_LOADSTRING = 115;
- OLEUI_ERR_OLEMEMALLOC = 116;
-
- OLEUI_ERR_STANDARDMAX = 117; { Start here for specific errors }
-
- { Hook type used in all structures }
-
- type
- TFNOleUIHook = function(Wnd: HWnd; Msg, WParam, LParam: Longint): Longint stdcall;
-
- { Miscellaneous utility functions }
-
- function OleUIAddVerbMenu(oleObj: IOleObject; pszShortType: PChar;
- menu: HMenu; uPos: Integer; uIDVerbMin: Integer; uIDVerbMax: Integer;
- bAddConvert: BOOL; idConvert: Integer; var outMenu: HMenu): BOOL; stdcall;
-
- { **** Insert Object dialog **** }
-
- { Insert object dialog structure }
-
- type
- POleUIInsertObject = ^TOleUIInsertObject;
- TOleUIInsertObject = record
- cbStruct: Longint; { Structure Size }
- dwFlags: Longint; { IN-OUT: Flags }
- hWndOwner: HWnd; { Owning window }
- lpszCaption: PChar; { Dialog caption bar contents }
- lpfnHook: TFNOleUIHook; { Hook callback }
- lCustData: Longint; { Custom data to pass to hook }
- hInstance: THandle; { Instance for customized template name }
- lpszTemplate: PChar; { Customized template name }
- hResource: HRsrc; { Customized template handle }
- clsid: TCLSID; { OUT: Return space for class ID }
- lpszFile: PChar; { IN-OUT: Filename for inserts or links }
- cchFile: Integer; { IN: Size of lpszFile buffer: MAX_PATH }
- cClsidExclude: Integer; { IN: CLSIDs in lpClsidExclude }
- lpClsidExclude: PCLSID; { IN: List of CLSIDs to exclude from listing }
- iid: TIID; { IN: Requested interface on creation }
- oleRender: Longint; { IN: Rendering option }
- lpFormatEtc: PFormatEtc; { IN: Desired format }
- lpIOleClientSite: IOleClientSite; { IN: Site to be use for the object }
- lpIStorage: IStorage; { IN: Storage used for the object }
- ppvObj: Pointer; { OUT: Where the object is returned }
- sc: HResult; { OUT: Result of creation calls }
- hMetaPict: HGlobal; { OUT: metafile aspect (METAFILEPICT) }
- end;
-
- { Insert object dialog function }
-
- function OleUIInsertObject(var Info: TOleUIInsertObject): Integer; stdcall;
-
- { Insert Object flags }
-
- const
- IOF_SHOWHELP = $00000001;
- IOF_SELECTCREATENEW = $00000002;
- IOF_SELECTCREATEFROMFILE = $00000004;
- IOF_CHECKLINK = $00000008;
- IOF_CHECKDISPLAYASICON = $00000010;
- IOF_CREATENEWOBJECT = $00000020;
- IOF_CREATEFILEOBJECT = $00000040;
- IOF_CREATELINKOBJECT = $00000080;
- IOF_DISABLELINK = $00000100;
- IOF_VERIFYSERVERSEXIST = $00000200;
- IOF_DISABLEDISPLAYASICON = $00000400;
- IOF_HIDECHANGEICON = $00000800;
- IOF_SHOWINSERTCONTROL = $00001000;
- IOF_SELECTCREATECONTROL = $00002000;
-
- { Insert Object specific error codes }
-
- const
- OLEUI_IOERR_LPSZFILEINVALID = OLEUI_ERR_STANDARDMAX + 0;
- OLEUI_IOERR_LPSZLABELINVALID = OLEUI_ERR_STANDARDMAX + 1;
- OLEUI_IOERR_HICONINVALID = OLEUI_ERR_STANDARDMAX + 2;
- OLEUI_IOERR_LPFORMATETCINVALID = OLEUI_ERR_STANDARDMAX + 3;
- OLEUI_IOERR_PPVOBJINVALID = OLEUI_ERR_STANDARDMAX + 4;
- OLEUI_IOERR_LPIOLECLIENTSITEINVALID = OLEUI_ERR_STANDARDMAX + 5;
- OLEUI_IOERR_LPISTORAGEINVALID = OLEUI_ERR_STANDARDMAX + 6;
- OLEUI_IOERR_SCODEHASERROR = OLEUI_ERR_STANDARDMAX + 7;
- OLEUI_IOERR_LPCLSIDEXCLUDEINVALID = OLEUI_ERR_STANDARDMAX + 8;
- OLEUI_IOERR_CCHFILEINVALID = OLEUI_ERR_STANDARDMAX + 9;
-
- { **** Paste Special dialog **** }
-
- { The OLEUIPASTE_xxx values are used by the TOleUIPasteEntry structure.
-
- OLEUIPASTE_ENABLEICON: If the container does not specify this flag for
- the entry in the TOleUIPasteEntry array passed as input to
- OleUIPasteSpecial, the DisplayAsIcon button will be unchecked and
- disabled when the the user selects the format that corresponds to
- the entry.
-
- OLEUIPASTE_PASTEONLY: Indicates that the entry in the TOleUIPasteEntry
- array is valid for pasting only.
-
- OLEUIPASTE_PASTE: Indicates that the entry in the TOleUIPasteEntry array
- is valid for pasting. It may also be valid for linking if any of
- the following linking flags are specified.
-
- If the entry in the TOleUIPasteEntry array is valid for linking, the
- following flags indicate which link types are acceptable by OR'ing
- together the appropriate OLEUIPASTE_LINKTYPE<#> values.
-
- These values correspond as follows to the array of link types passed to
- OleUIPasteSpecial:
-
- OLEUIPASTE_LINKTYPE1 = arrLinkTypes[0]
- OLEUIPASTE_LINKTYPE2 = arrLinkTypes[1]
- OLEUIPASTE_LINKTYPE3 = arrLinkTypes[2]
- OLEUIPASTE_LINKTYPE4 = arrLinkTypes[3]
- OLEUIPASTE_LINKTYPE5 = arrLinkTypes[4]
- OLEUIPASTE_LINKTYPE6 = arrLinkTypes[5]
- OLEUIPASTE_LINKTYPE7 = arrLinkTypes[6]
- OLEUIPASTE_LINKTYPE8 = arrLinkTypes[7]
-
- where,
- UINT arrLinkTypes[8] is an array of registered clipboard formats for
- linking. A maximium of 8 link types are allowed. }
-
- const
- OLEUIPASTE_ENABLEICON = 2048; { enable display as icon }
- OLEUIPASTE_PASTEONLY = 0;
- OLEUIPASTE_PASTE = 512;
- OLEUIPASTE_LINKANYTYPE = 1024;
- OLEUIPASTE_LINKTYPE1 = 1;
- OLEUIPASTE_LINKTYPE2 = 2;
- OLEUIPASTE_LINKTYPE3 = 4;
- OLEUIPASTE_LINKTYPE4 = 8;
- OLEUIPASTE_LINKTYPE5 = 16;
- OLEUIPASTE_LINKTYPE6 = 32;
- OLEUIPASTE_LINKTYPE7 = 64;
- OLEUIPASTE_LINKTYPE8 = 128;
-
- { TOleUIPasteEntry structure
-
- An array of TOleUIPasteEntry entries is specified for the PasteSpecial
- dialog box. Each entry includes a TFormatEtc which specifies the
- formats that are acceptable, a string that is to represent the format
- in the dialog's list box, a string to customize the result text of the
- dialog and a set of flags from the OLEUIPASTE_xxx constants. The
- flags indicate if the entry is valid for pasting only, linking only or
- both pasting and linking. }
-
- type
- POleUIPasteEntry = ^TOleUIPasteEntry;
- TOleUIPasteEntry = record
- fmtetc: TFormatEtc; { Format that is acceptable }
- lpstrFormatName: PChar; { String that represents the format
- to the user. %s is replaced by the
- full user type name of the object }
- lpstrResultText: PChar; { String to customize the result text
- of the dialog when the user
- selects the format correspoding to
- this entry. Any %s in this string
- is replaced by the the application
- name or FullUserTypeName of the
- object on the clipboard }
- dwFlags: Longint; { Values from OLEUIPASTE_xxx set }
- dwScratchSpace: Longint; { Scratch space used internally }
- end;
-
- { Maximum number of link types }
-
- const
- PS_MAXLINKTYPES = 8;
-
- type
- POleUIPasteSpecial = ^TOleUIPasteSpecial;
- TOleUIPasteSpecial = record
- cbStruct: Longint; { Structure Size }
- dwFlags: Longint; { IN-OUT: Flags }
- hWndOwner: HWnd; { Owning window }
- lpszCaption: PChar; { Dialog caption bar contents }
- lpfnHook: TFNOleUIHook; { Hook callback }
- lCustData: Longint; { Custom data to pass to hook }
- hInstance: THandle; { Instance for customized template name }
- lpszTemplate: PChar; { Customized template name }
- hResource: HRsrc; { Customized template handle }
- lpSrcDataObj: IDataObject; { IN-OUT: Source IDataObject on the clipboard }
- arrPasteEntries: POleUIPasteEntry; { IN: Array of acceptable formats }
- cPasteEntries: Integer; { IN: No. of TOleUIPasteEntry array entries }
- arrLinkTypes: PLongint; { IN: List of acceptable link types }
- cLinkTypes: Integer; { IN: Number of link types }
- cClsidExclude: Integer; { IN: Number of CLSIDs in lpClsidExclude }
- lpClsidExclude: PCLSID; { IN: List of CLSIDs to exclude from list }
- nSelectedIndex: Integer; { OUT: Index that the user selected }
- fLink: BOOL; { OUT: Indicates if Paste or PasteLink }
- hMetaPict: HGlobal; { OUT: Handle to Metafile containing icon }
- sizel: TSize; { OUT: size of object/link in its source
- may be 0,0 if different display
- aspect is chosen }
- end;
-
- function OleUIPasteSpecial(var Info: TOleUIPasteSpecial): Integer; stdcall;
-
- { Paste Special specific flags }
-
- const
- PSF_SHOWHELP = $00000001;
- PSF_SELECTPASTE = $00000002;
- PSF_SELECTPASTELINK = $00000004;
- PSF_CHECKDISPLAYASICON = $00000008;
- PSF_DISABLEDISPLAYASICON = $00000010;
- PSF_HIDECHANGEICON = $00000020;
- PSF_STAYONCLIPBOARDCHANGE = $00000040;
- PSF_NOREFRESHDATAOBJECT = $00000080;
-
- { Paste Special specific error codes }
-
- const
- OLEUI_IOERR_SRCDATAOBJECTINVALID = OLEUI_ERR_STANDARDMAX + 0;
- OLEUI_IOERR_ARRPASTEENTRIESINVALID = OLEUI_ERR_STANDARDMAX + 1;
- OLEUI_IOERR_ARRLINKTYPESINVALID = OLEUI_ERR_STANDARDMAX + 2;
- OLEUI_PSERR_CLIPBOARDCHANGED = OLEUI_ERR_STANDARDMAX + 3;
- OLEUI_PSERR_GETCLIPBOARDFAILED = OLEUI_ERR_STANDARDMAX + 4;
-
- { **** Edit Links dialog **** }
-
- { IOleUILinkContainer interface
-
- This interface must be implemented by container applications that
- want to use the EditLinks dialog. the EditLinks dialog calls back
- to the container app to perform the OLE functions to manipulate
- the links within the container. }
-
- type
- IOleUILinkContainer = interface(IUnknown)
- ['{00000000-0000-0000-0000-000000000000}'] //!!!
- function GetNextLink(dwLink: Longint): Longint; stdcall;
- function SetLinkUpdateOptions(dwLink: Longint; dwUpdateOpt: Longint): HResult; stdcall;
- function GetLinkUpdateOptions(dwLink: Longint;
- var dwUpdateOpt: Longint): HResult; stdcall;
- function SetLinkSource(dwLink: Longint; pszDisplayName: PChar;
- lenFileName: Longint; var chEaten: Longint;
- fValidateSource: BOOL): HResult; stdcall;
- function GetLinkSource(dwLink: Longint; var pszDisplayName: PChar;
- var lenFileName: Longint; var pszFullLinkType: PChar;
- var pszShortLinkType: PChar; var fSourceAvailable: BOOL;
- var fIsSelected: BOOL): HResult; stdcall;
- function OpenLinkSource(dwLink: Longint): HResult; stdcall;
- function UpdateLink(dwLink: Longint; fErrorMessage: BOOL;
- fErrorAction: BOOL): HResult; stdcall;
- function CancelLink(dwLink: Longint): HResult; stdcall;
- end;
-
- { TOleIUEditLinks structure }
-
- type
- POleUIEditLinks = ^TOleUIEditLinks;
- TOleUIEditLinks = record
- cbStruct: Longint; { Structure Size }
- dwFlags: Longint; { IN-OUT: Flags }
- hWndOwner: HWnd; { Owning window }
- lpszCaption: PChar; { Dialog caption bar contents }
- lpfnHook: TFNOleUIHook; { Hook callback }
- lCustData: Longint; { Custom data to pass to hook }
- hInstance: THandle; { Instance for customized template name }
- lpszTemplate: PChar; { Customized template name }
- hResource: HRsrc; { Customized template handle }
- OleUILinkContainer: IOleUILinkContainer; { IN: Interface to manipulate
- links in the container }
- end;
-
- const
- OLEUI_ELERR_LINKCNTRNULL = OLEUI_ERR_STANDARDMAX + 0;
- OLEUI_ELERR_LINKCNTRINVALID = OLEUI_ERR_STANDARDMAX + 1;
-
- function OleUIEditLinks(var Info: TOleUIEditLinks): Integer; stdcall;
-
- { Edit Links flags }
-
- const
- ELF_SHOWHELP = $00000001;
- ELF_DISABLEUPDATENOW = $00000002;
- ELF_DISABLEOPENSOURCE = $00000004;
- ELF_DISABLECHANGESOURCE = $00000008;
- ELF_DISABLECANCELLINK = $00000010;
-
- { **** Change Icon dialog **** }
-
- type
- POleUIChangeIcon = ^TOleUIChangeIcon;
- TOleUIChangeIcon = record
- cbStruct: Longint; { Structure Size }
- dwFlags: Longint; { IN-OUT: Flags }
- hWndOwner: HWnd; { Owning window }
- lpszCaption: PChar; { Dialog caption bar contents }
- lpfnHook: TFNOleUIHook; { Hook callback }
- lCustData: Longint; { Custom data to pass to hook }
- hInstance: THandle; { Instance for customized template name }
- lpszTemplate: PChar; { Customized template name }
- hResource: HRsrc; { Customized template handle }
- hMetaPict: HGlobal; { IN-OUT: Current and final image.
- Source of the icon is embedded in
- the metafile itself }
- clsid: TCLSID; { IN: class used to get Default icon }
- szIconExe: array[0..MAX_PATH - 1] of Char; { IN: exlicit icon source path }
- cchIconExe: Integer; { IN: number of characters in szIconExe }
- end;
-
- function OleUIChangeIcon(var Info: TOleUIChangeIcon): Integer; stdcall;
-
- { Change Icon flags }
-
- const
- CIF_SHOWHELP = $00000001;
- CIF_SELECTCURRENT = $00000002;
- CIF_SELECTDEFAULT = $00000004;
- CIF_SELECTFROMFILE = $00000008;
- CIF_USEICONEXE = $00000010;
-
- { Change Icon specific error codes }
-
- const
- OLEUI_CIERR_MUSTHAVECLSID = OLEUI_ERR_STANDARDMAX + 0;
- OLEUI_CIERR_MUSTHAVECURRENTMETAFILE = OLEUI_ERR_STANDARDMAX + 1;
- OLEUI_CIERR_SZICONEXEINVALID = OLEUI_ERR_STANDARDMAX + 2;
-
- { Property used by ChangeIcon dialog to give its parent window access to
- its hDlg. The PasteSpecial dialog may need to force the ChgIcon dialog
- down if the clipboard contents change underneath it. If so it will send
- a IDCANCEL command to the ChangeIcon dialog. }
-
- const
- PROP_HWND_CHGICONDLG = 'HWND_CIDLG';
-
- { **** Convert dialog **** }
-
- type
- POleUIConvert = ^TOleUIConvert;
- TOleUIConvert = record
- cbStruct: Longint; { Structure Size }
- dwFlags: Longint; { IN-OUT: Flags }
- hWndOwner: HWnd; { Owning window }
- lpszCaption: PChar; { Dialog caption bar contents }
- lpfnHook: TFNOleUIHook; { Hook callback }
- lCustData: Longint; { Custom data to pass to hook }
- hInstance: THandle; { Instance for customized template name }
- lpszTemplate: PChar; { Customized template name }
- hResource: HRsrc; { Customized template handle }
- clsid: TCLSID; { IN: Class ID sent in to dialog: IN only }
- clsidConvertDefault: TCLSID; { IN: use as convert default: IN only }
- clsidActivateDefault: TCLSID; { IN: use as activate default: IN only }
- clsidNew: TCLSID; { OUT: Selected Class ID }
- dvAspect: Longint; { IN-OUT: either DVASPECT_CONTENT or
- DVASPECT_ICON }
- wFormat: Word; { IN" Original data format }
- fIsLinkedObject: BOOL; { IN: true if object is linked }
- hMetaPict: HGlobal; { IN-OUT: metafile icon image }
- lpszUserType: PChar; { IN-OUT: user type name of original class.
- We'll do lookup if NULL. This gets freed
- on exit }
- fObjectsIconChanged: BOOL; { OUT: TRUE == ChangeIcon was called }
- lpszDefLabel: PChar; { IN-OUT: default label to use for icon.
- if NULL, the short user type name
- will be used. if the object is a
- link, the caller should pass the
- DisplayName of the link source
- This gets freed on exit }
- cClsidExclude: Integer; { IN: No. of CLSIDs in lpClsidExclude }
- lpClsidExclude: PCLSID; { IN: List of CLSIDs to exclude from list }
- end;
-
- function OleUIConvert(var Info: TOleUIConvert): Integer; stdcall;
-
- { Determine if there is at least one class that can Convert or ActivateAs
- the given clsid }
-
- function OleUICanConvertOrActivateAs(const clsid: TCLSID;
- fIsLinkedObject: BOOL; wFormat: Word): BOOL; stdcall;
-
- { Convert Dialog flags }
-
- const
- CF_SHOWHELPBUTTON = $00000001;
- CF_SETCONVERTDEFAULT = $00000002;
- CF_SETACTIVATEDEFAULT = $00000004;
- CF_SELECTCONVERTTO = $00000008;
- CF_SELECTACTIVATEAS = $00000010;
- CF_DISABLEDISPLAYASICON = $00000020;
- CF_DISABLEACTIVATEAS = $00000040;
- CF_HIDECHANGEICON = $00000080;
- CF_CONVERTONLY = $00000100;
-
- { Convert specific error codes }
-
- const
- OLEUI_CTERR_CLASSIDINVALID = OLEUI_ERR_STANDARDMAX + 1;
- OLEUI_CTERR_DVASPECTINVALID = OLEUI_ERR_STANDARDMAX + 2;
- OLEUI_CTERR_CBFORMATINVALID = OLEUI_ERR_STANDARDMAX + 3;
- OLEUI_CTERR_HMETAPICTINVALID = OLEUI_ERR_STANDARDMAX + 4;
- OLEUI_CTERR_STRINGINVALID = OLEUI_ERR_STANDARDMAX + 5;
-
- { **** Busy dialog **** }
-
- type
- POleUIBusy = ^TOleUIBusy;
- TOleUIBusy = record
- cbStruct: Longint; { Structure Size }
- dwFlags: Longint; { IN-OUT: Flags }
- hWndOwner: HWnd; { Owning window }
- lpszCaption: PChar; { Dialog caption bar contents }
- lpfnHook: TFNOleUIHook; { Hook callback }
- lCustData: Longint; { Custom data to pass to hook }
- hInstance: THandle; { Instance for customized template name }
- lpszTemplate: PChar; { Customized template name }
- hResource: HRsrc; { Customized template handle }
- task: HTask; { IN: HTask which is blocking }
- lphWndDialog: ^HWnd; { IN: Dialog's HWND is placed here }
- end;
-
- function OleUIBusy(var Info: TOleUIBusy): Integer; stdcall;
-
- { Flags for the Busy dialog }
-
- const
- BZ_DISABLECANCELBUTTON = $00000001;
- BZ_DISABLESWITCHTOBUTTON = $00000002;
- BZ_DISABLERETRYBUTTON = $00000004;
- BZ_NOTRESPONDINGDIALOG = $00000008;
-
- { Busy specific error/return codes }
-
- const
- OLEUI_BZERR_HTASKINVALID = OLEUI_ERR_STANDARDMAX + 0;
- OLEUI_BZ_SWITCHTOSELECTED = OLEUI_ERR_STANDARDMAX + 1;
- OLEUI_BZ_RETRYSELECTED = OLEUI_ERR_STANDARDMAX + 2;
- OLEUI_BZ_CALLUNBLOCKED = OLEUI_ERR_STANDARDMAX + 3;
-
- { **** Object Properties dialog **** }
-
- type
- IOleUIObjInfo = interface(IUnknown)
- ['{00000000-0000-0000-0000-000000000000}'] //!!!
- function GetObjectInfo(dwObject: Longint;
- var dwObjSize: Longint; var lpszLabel: PChar;
- var lpszType: PChar; var lpszShortType: PChar;
- var lpszLocation: PChar): HResult; stdcall;
- function GetConvertInfo(dwObject: Longint; var ClassID: TCLSID;
- var wFormat: Word; var ConvertDefaultClassID: TCLSID;
- var lpClsidExclude: PCLSID; var cClsidExclude: Longint): HResult; stdcall;
- function ConvertObject(dwObject: Longint; const clsidNew: TCLSID): HResult; stdcall;
- function GetViewInfo(dwObject: Longint; var hMetaPict: HGlobal;
- var dvAspect: Longint; var nCurrentScale: Integer): HResult; stdcall;
- function SetViewInfo(dwObject: Longint; hMetaPict: HGlobal;
- dvAspect: Longint; nCurrentScale: Integer;
- bRelativeToOrig: BOOL): HResult; stdcall;
- end;
-
- type
- IOleUILinkInfo = interface(IOleUILinkContainer)
- ['{00000000-0000-0000-0000-000000000000}'] //!!!
- function GetLastUpdate(dwLink: Longint; var LastUpdate: TFileTime): HResult; stdcall;
- end;
-
- type
- POleUIGnrlProps = ^TOleUIGnrlProps;
- TOleUIGnrlProps = record
- cbStruct: Longint;
- dwFlags: Longint;
- dwReserved1: array[1..2] of Longint;
- lpfnHook: TFNOleUIHook;
- lCustData: Longint;
- dwReserved2: array[1..3] of Longint;
- lpOP: Pointer;
- end;
-
- type
- POleUIViewProps = ^TOleUIViewProps;
- TOleUIViewProps = record
- cbStruct: Longint;
- dwFlags: Longint;
- dwReserved1: array[1..2] of Longint;
- lpfnHook: TFNOleUIHook;
- lCustData: Longint;
- dwReserved2: array[1..3] of Longint;
- lpOP: Pointer;
- nScaleMin: Integer;
- nScaleMax: Integer;
- end;
-
- { Flags for TOleUIViewProps }
-
- const
- VPF_SELECTRELATIVE = $00000001; { IN: relative to orig }
- VPF_DISABLERELATIVE = $00000002; { IN: disable relative to orig }
- VPF_DISABLESCALE = $00000004; { IN: disable scale option }
-
- type
- POleUILinkProps = ^TOleUILinkProps;
- TOleUILinkProps = record
- cbStruct: Longint;
- dwFlags: Longint;
- dwReserved1: array[1..2] of Longint;
- lpfnHook: TFNOleUIHook;
- lCustData: Longint;
- dwReserved2: array[1..3] of Longint;
- lpOP: Pointer;
- end;
-
- type
- POleUIObjectProps = ^TOleUIObjectProps;
- TOleUIObjectProps = record
- cbStruct: Longint; { Structure Size }
- dwFlags: Longint; { IN-OUT: global flags for the sheet }
- lpPS: PPropSheetHeader; { IN: property sheet header }
- dwObject: Longint; { IN: identifier for the object }
- lpObjInfo: IOleUIObjInfo; { IN: interface to manipulate object }
- dwLink: Longint; { IN: identifier for the link }
- lpLinkInfo: IOleUILinkInfo; { IN: interface to manipulate link }
- lpGP: POleUIGnrlProps; { IN: general page }
- lpVP: POleUIViewProps; { IN: view page }
- lpLP: POleUILinkProps; { IN: link page }
- end;
-
- function OleUIObjectProperties(var Info: TOleUIObjectProps): Integer; stdcall;
-
- { Flags for OLEUIOBJECTPROPS }
-
- const
- OPF_OBJECTISLINK = $00000001;
- OPF_NOFILLDEFAULT = $00000002;
- OPF_SHOWHELP = $00000004;
- OPF_DISABLECONVERT = $00000008;
-
- { Errors for OleUIObjectProperties }
-
- const
- OLEUI_OPERR_SUBPROPNULL = OLEUI_ERR_STANDARDMAX + 0;
- OLEUI_OPERR_SUBPROPINVALID = OLEUI_ERR_STANDARDMAX + 1;
- OLEUI_OPERR_PROPSHEETNULL = OLEUI_ERR_STANDARDMAX + 2;
- OLEUI_OPERR_PROPSHEETINVALID = OLEUI_ERR_STANDARDMAX + 3;
- OLEUI_OPERR_SUPPROP = OLEUI_ERR_STANDARDMAX + 4;
- OLEUI_OPERR_PROPSINVALID = OLEUI_ERR_STANDARDMAX + 5;
- OLEUI_OPERR_PAGESINCORRECT = OLEUI_ERR_STANDARDMAX + 6;
- OLEUI_OPERR_INVALIDPAGES = OLEUI_ERR_STANDARDMAX + 7;
- OLEUI_OPERR_NOTSUPPORTED = OLEUI_ERR_STANDARDMAX + 8;
- OLEUI_OPERR_DLGPROCNOTNULL = OLEUI_ERR_STANDARDMAX + 9;
- OLEUI_OPERR_LPARAMNOTZERO = OLEUI_ERR_STANDARDMAX + 10;
- OLEUI_GPERR_STRINGINVALID = OLEUI_ERR_STANDARDMAX + 11;
- OLEUI_GPERR_CLASSIDINVALID = OLEUI_ERR_STANDARDMAX + 12;
- OLEUI_GPERR_LPCLSIDEXCLUDEINVALID = OLEUI_ERR_STANDARDMAX + 13;
- OLEUI_GPERR_CBFORMATINVALID = OLEUI_ERR_STANDARDMAX + 14;
- OLEUI_VPERR_METAPICTINVALID = OLEUI_ERR_STANDARDMAX + 15;
- OLEUI_VPERR_DVASPECTINVALID = OLEUI_ERR_STANDARDMAX + 16;
- OLEUI_LPERR_LINKCNTRNULL = OLEUI_ERR_STANDARDMAX + 17;
- OLEUI_LPERR_LINKCNTRINVALID = OLEUI_ERR_STANDARDMAX + 18;
- OLEUI_OPERR_PROPERTYSHEET = OLEUI_ERR_STANDARDMAX + 19;
-
- { wParam used by PSM_QUERYSIBLINGS }
-
- const
- OLEUI_QUERY_GETCLASSID = $FF00; { override class id for icon }
- OLEUI_QUERY_LINKBROKEN = $FF01; { after link broken }
-
- implementation
-
- const
- OleDlgDLL = 'oledlg.dll';
-
- function OleUIAddVerbMenu; external OleDlgDLL name 'OleUIAddVerbMenuA';
- function OleUIInsertObject; external OleDlgDLL name 'OleUIInsertObjectA';
- function OleUIPasteSpecial; external OleDlgDLL name 'OleUIPasteSpecialA';
- function OleUIEditLinks; external OleDlgDLL name 'OleUIEditLinksA';
- function OleUIChangeIcon; external OleDlgDLL name 'OleUIChangeIconA';
- function OleUIConvert; external OleDlgDLL name 'OleUIConvertA';
- function OleUICanConvertOrActivateAs; external OleDlgDLL name 'OleUICanConvertOrActivateAs';
- function OleUIBusy; external OleDlgDLL name 'OleUIBusyA';
- function OleUIObjectProperties; external OleDlgDLL name 'OleUIObjectPropertiesA';
-
- end.
-